/**
 * User: jacek
 * Date: 2008-06-07
 * Time: 17:28:59
 */
package elka.isi.individual;

import elka.isi.gene.AnimalGene;

public abstract class HerbivoreAnimalIndivdual extends AnimalIndividual {

    protected double harvestingScore;
    protected double nutritionalScore; // wartosc odzywcza zwierzaka

    /**
     * @return speed + strength + 5log(memory) + 3 * eyesigth
     */
    protected double countHarvestingScore() {
        AnimalGene gene = (AnimalGene) getGenotype();

        int speed = countSpeed();
        float strength = countStrength();
        int memory = gene.getGene(AnimalGene.MEMORY_GENE);
        int eyesigth = gene.getGene(AnimalGene.EYESIGTH_GENE);

        double harvesting = speed + strength + 5 * Math.log(memory) + 3 * eyesigth;

        /* normalizacja */
        harvesting = normalize(harvesting,  2, 300);
        harvesting = correctRange("harvestingScore",harvesting);

        return harvesting;
    }
    
    protected double countSizeToFoodScore() {
    	AnimalGene  gene = (AnimalGene) getGenotype();
    	return gene.getGene(AnimalGene.SIZE_GENE);
    }
    

    public double getHarvestingScore() {
        return harvestingScore;
    }
	/**
	 * @return
	 */
	public double getNutritionalScore() {
		return nutritionalScore;
	}

}
